package com.restaurant.application.minifacade.data;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.lang.String;
import java.util.List;

public class ShopBO implements PickableBean {
    
    public static final String FN_SHOPID = "shopId";
    public static final String FN_SHOPNAME = "shopName";
    public static final String FN_ADDRESS = "address";
    public static final String FN_PHONE = "phone";
    public static final String FN_IMGURL = "imgUrl";
    
    public static final List<String> FIELD_NAMES = Lists.newArrayList(
             FN_SHOPID,
             FN_SHOPNAME,
             FN_ADDRESS,
             FN_PHONE,
             FN_IMGURL);
    
    private String shopId;
    private String shopName;
    private String address;
    private String phone;
    private String imgUrl;
    
    public ShopBO(String shopId, String shopName, String address, String phone, String imgUrl) {
        setShopId(shopId);
        setShopName(shopName);
        setAddress(address);
        setPhone(phone);
        setImgUrl(imgUrl);
    }
    
    public ShopBO() {
    }
    
    public ShopBO duplicate() {
        ShopBO result = new ShopBO();
        result.shopId = this.shopId;
        result.shopName = this.shopName;
        result.address = this.address;
        result.phone = this.phone;
        result.imgUrl = this.imgUrl;
        return result;
    }
    
    @Override
    public String toString() {
        return Convert.toJson(this);
    }
    
    public String getShopId() {
        return shopId;
    }
    
    public void  setShopId(String value) {
        this.shopId = value;
    }
    
    public ShopBO withShopId(String value) {
        setShopId(value);
        return this;
    }
    
    public ShopBO withShopId(String value, String defaultValue) {
        setShopId(value == null ? defaultValue : value);
        return this;
    }
    
    public String getShopName() {
        return shopName;
    }
    
    public void  setShopName(String value) {
        this.shopName = value;
    }
    
    public ShopBO withShopName(String value) {
        setShopName(value);
        return this;
    }
    
    public ShopBO withShopName(String value, String defaultValue) {
        setShopName(value == null ? defaultValue : value);
        return this;
    }
    
    public String getAddress() {
        return address;
    }
    
    public void  setAddress(String value) {
        this.address = value;
    }
    
    public ShopBO withAddress(String value) {
        setAddress(value);
        return this;
    }
    
    public ShopBO withAddress(String value, String defaultValue) {
        setAddress(value == null ? defaultValue : value);
        return this;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void  setPhone(String value) {
        this.phone = value;
    }
    
    public ShopBO withPhone(String value) {
        setPhone(value);
        return this;
    }
    
    public ShopBO withPhone(String value, String defaultValue) {
        setPhone(value == null ? defaultValue : value);
        return this;
    }
    
    public String getImgUrl() {
        return imgUrl;
    }
    
    public void  setImgUrl(String value) {
        this.imgUrl = value;
    }
    
    public ShopBO withImgUrl(String value) {
        setImgUrl(value);
        return this;
    }
    
    public ShopBO withImgUrl(String value, String defaultValue) {
        setImgUrl(value == null ? defaultValue : value);
        return this;
    }
    
    public Object getValueOf(String name) {
        switch(name) {
        case "shopId": return getShopId();
        case "shopName": return getShopName();
        case "address": return getAddress();
        case "phone": return getPhone();
        case "imgUrl": return getImgUrl();
        }
        return null;
    }
    
    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }
    
    @Override
    public int hashCode() {
        return signature().hashCode();
    }
    
    @Override
    public boolean equals(Object o) {
        if(!(o instanceof ShopBO)) return false;
        return signature().equals(((ShopBO)o).signature());
    }
    
    public String signature() {
        throw new RuntimeException("Bean ShopBO has no signature defined, no hash code or equals possible.");
    }
}
